import random
num = random.randint(1,100)

count = 0

i = True
while i:
    guess = int(input("输入猜测数字"))
    count += 1
    if guess == num:
        print("猜中了")
        i = False
    else:
        if guess > num:
            print("猜大了")
        else:
            print("猜小了")

print(f"您猜了{count}次")